{% block main-content %}
<div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  <h4 class="modal-title">
    <span> 切换到新的机房 </span>
  </h4>
</div>
<div class="modal-body">

<form action="{%url 'idcops:switch_onidc'%}" method="POST" role="form" class="form-horizontal" id="switch-new-idc">
  <div class="box-body">
    <div class="col-10">
      {% csrf_token %}
      <div class="form-group">
        <label for="new_idc">请选择机房</label>
        <select name="new_idc" class="form-control">
          {%for idc in idcs%}
          <option value="{{idc.pk}}" {%if request.user.onidc == idc %} selected{%endif%}>{{idc.name}}</option>
          {%endfor%}
        </select>
      </div>
    </div>
  </div>
  <div class="box-footer">
    <button type="button" class="btn btn-default btn-sm" type="button" class="close" data-dismiss="modal"
      aria-label="Close">取消</button>
    <div class="pull-right">
      <button type="submit" name="_last" class="btn btn-primary btn-sm margin-r-5">提交</button>
    </div>
  </div>
</form>
</div>
{% endblock main-content %}